Skip to content

feat: endpoint for general scheme catalog search#275

Draft
wtlow003 wants to merge 1 commit intostgfrom
feat/scheme-catalog-endpoints
Draft

feat: endpoint for general scheme catalog search#275
wtlow003 wants to merge 1 commit intostgfrom
feat/scheme-catalog-endpoints

Conversation

@wtlow003
Copy link
Collaborator

@wtlow003 wtlow003 commented Feb 20, 2026

Problem

There is no dedicated endpoint for browsing the scheme catalog — clients currently have
to use the semantic search endpoint even when they just want to list or filter schemes by
structured attributes (agency, planning area, scheme type).

Link to Issue:

#268
dependent on #280

Changes

  • Add catalog Cloud Function (backend/functions/schemes/catalog.py) — a new GET endpoint
    that returns paginated scheme results, with optional filtering by agency, area, or
    scheme_type
  • Add catalog_pagination.py utility (backend/functions/utils/catalog_pagination.py) with
    signed cursor-based pagination using HMAC-SHA256
  • Register catalog endpoint in main.py and add it to the keepalive warmup scheduler
    (endpoints.py)
  • Add 3 Firestore composite indexes for the new filter+sort query shapes
    (firestore.indexes.json)
  • Add integration tests (backend/tests/integration/test_catalog.py) and a
    test-endpoint.http file for manual testing

Why

The search endpoint is optimised for semantic/fuzzy queries and unsuitable for structured
browsing. A dedicated catalog endpoint allows consumers to page through schemes by
category without search overhead. Cursor-based pagination with HMAC signing prevents cursor tampering. Supporting only one filter at a time keeps query complexity manageable
while still covering the main use cases.

Testing

  • Tested locally via Firebase emulator using test-endpoint.http — verified paginated
    responses, filter combinations, cursor continuity, and error cases (invalid params,
    unknown params, multiple filters)
  • Integration tests pass (pytest backend/tests/integration/test_catalog.py)

@wtlow003 wtlow003 self-assigned this Feb 20, 2026
@wtlow003 wtlow003 added enhancement New feature or request state: pending pull review still pending changes labels Feb 20, 2026
@wtlow003 wtlow003 force-pushed the feat/scheme-catalog-endpoints branch 2 times, most recently from 4f73d44 to f2691f2 Compare February 20, 2026 16:46
@wtlow003 wtlow003 force-pushed the feat/scheme-catalog-endpoints branch from 4fbd57b to b64a517 Compare March 3, 2026 18:13
@longwind48
Copy link
Collaborator

@wtlow003 update the description

@wtlow003 wtlow003 force-pushed the feat/scheme-catalog-endpoints branch from b64a517 to dc7a653 Compare March 11, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request state: pending pull review still pending changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants